﻿using System;
using System.Windows;
using MyFloridaHouse.ServiceConn.DistrBldrSvcRef;

namespace MyFloridaHouse.libSvOpenDistricts.DataService
{
    public partial class ServiceDAL
    {

        private int _getACSReportDefinitionRequestCount = 0;
        public int getACSReportDefinitionRequestCount
        {
            get { return _getACSReportDefinitionRequestCount; }
            set { if (_getACSReportDefinitionRequestCount != value) { _getACSReportDefinitionRequestCount = value; NotifyPropertyChanged("getACSReportDefinitionRequestCount"); } }
        }

        public void GetACSReportDefinition(System.EventHandler<GetACSReportDefinitionCompletedEventArgs> completedHandler)
        {
            try
            {
                //MyDistrictBuilderServiceClient proxy = new MyDistrictBuilderServiceClient(myRelativeBinding, myRelativeCensusDataServiceAddress);
				var proxy = new DistrBldrClient(_relativeBindingName);
                proxy.GetACSReportDefinitionCompleted += completedHandler;
                proxy.GetACSReportDefinitionAsync();
                getACSReportDefinitionRequestCount++;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
